#ifndef MAINDIALOG_H
#define MAINDIALOG_H

#include <QDialog>
#include <QMqttClient>

QT_BEGIN_NAMESPACE
namespace Ui { class MainDialog; }
QT_END_NAMESPACE

class MainDialog : public QDialog
{
    Q_OBJECT

public:
    MainDialog(QWidget *parent = nullptr);
    ~MainDialog();

private slots:
    void onDisconnected();
    void onConnected();
    void onMessageReceived(const QByteArray &message, const QMqttTopicName &topic);
    void on_btnLampOn_clicked();
    void on_btnFanOn_clicked();

private:
    Ui::MainDialog *ui;
    QMqttClient* m_mqtt;
};
#endif // MAINDIALOG_H
